from django.db import models

# Create your models here.
#菜品表
class dishes(models.Model):
    name=models.CharField(max_length=255)
    price=models.DecimalField(max_digits=6,decimal_places=2)
    category=models.CharField(max_length=255)
    description=models.CharField(max_length=255)
    status = models.IntegerField()
    create_time=models.DateTimeField(auto_now_add=True)
    updata_time=models.DateTimeField(auto_now=True)

#员工表
class employees(models.Model):
    name = models.CharField(max_length=255)
    position = models.CharField(max_length=255)
    department = models.CharField(max_length=255)
    password = models.CharField(max_length=255)
    create_time = models.DateTimeField(auto_now_add=True)
    updata_time = models.DateTimeField(auto_now=True)
#订单表
class orders(models.Model):
    customer_name=models.CharField(max_length=255)
    quantity=models.IntegerField()
    status = models.IntegerField()
    order_time = models.DateTimeField(auto_now_add=True)
    dish_id=models.ForeignKey(dishes,on_delete=models.CASCADE,related_name='orders')
    employee_id=models.ForeignKey(employees,on_delete=models.CASCADE,related_name='orders')
